<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PostgreSQL SELECT Example 1</title>
<meta name="description" content="If we want to fetch all rows from the actor table the following PostgreSQL SELECT statement can be used.">
</head>
<body>
<h1>List of all actors in the table</h1>
<?php

$ip = '127.0.0.1';
$details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));
echo $details->city; // -> "Mountain View"
echo "<br>";
$db = pg_connect("host=localhost dbname=jetlinks user=postgres password=jetlinks");
#$aa= '{"navTheme":"dark","primaryColor":"#1890ff","layout":"sidemenu","contentWidth":"Fluid","fixedHeader":false,"autoHideHeader":false,"fixSiderbar":false,
$aa= '{"navTheme":"dark","primaryColor":"#1890ff","layout":"sidemenu","contentWidth":"Fluid","fixedHeader":false,"autoHideHeader":false,"fixSiderbar":false,"colorWeak":false,"menu":{"locale":true},"title":"EOLA","pwa":false,"iconfontUrl":"","titleIcon":"http://127.0.0.1/images/title.jpg"}';

$query1="INSERT INTO s_system_conf (id, front_config) VALUES ('default', '". $aa . "');";
$result = pg_query($db,$query1);
echo "<BR>".$query1."<BR>".$result."<BR>";
$query = "UPDATE s_system_conf SET front_config='" .$aa ."' WHERE id='default';";
$result = pg_query($db,$query);
echo "<br>".$query."<BR>".$result."<BR";
$result = pg_query($db,"SELECT * FROM s_user");
echo "<table>";
while($row=pg_fetch_assoc($result)){echo "<tr>";
echo "<td align='center' width='200'>" . $row['password'] . "</td>";
echo "<td align='center' width='200'>" . $row['salt'] . "</td>";
echo "<td align='center' width='200'>" . $row['create_time'] . "</td>";
echo "<td align='center' width='200'>" . $row['name'] . "</td>";
echo "<td align='center' width='200'>" . $row['creator_id'] . "</td>";
echo "<td align='center' width='200'>" . $row['id'] . "</td>";
echo "<td align='center' width='200'>" . $row['type'] . "</td>";
echo "<td align='center' width='200'>" . $row['username'] . "</td>";
echo "<td align='center' width='200'>" . $row['status'] . "</td>";
echo "</tr>";}echo "</table>";?>
</div>
</body>
</html>